#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	int n, x, k, ans;
	cin >> n;
	n /= 52;
	n /= 7;
	x = n - 3;
	if (x > 100) {
		x = 100;
	}
	for (int i = x; i >= 1; i--) {
		ans = n - i;
		if (ans % 3 == 0) {
			cout << i << endl << ans / 3 << endl;
			break;
		}
	}
	return 0;
}